<?php

namespace DesignNew\Visitor;

require('../vendor/autoload.php');
class VisitClient
{
    public function __construct()
    {
        $monkey = new Monkey();
        $lion = new Lion();
        $dolphin = new Dolphin();

        $speak = new Speak();

        $monkey->accept($speak);
        $lion->accept($speak);
        $dolphin->accept($speak);

        //对新增的jump动作进行以下引用
        $jump = new Jump();
        $monkey->accept($jump);
        $lion->accept($jump);
        $dolphin->accept($jump);
    }
}

$client = new VisitClient();